<!--#include file="Config.asp"-->
<!--#include file="emp_is.asp"-->
<!--#include file="Header.asp"-->

<%
SKUID=int(request("SKUID"))
%>

<div style="width:1024px;margin:0 auto;">
	<div class="easyui-panel" title="SKUID:【<%=SKUID%>】IT资产的基本资料">

<table class="table">
<TR>
<FORM METHOD=POST ACTION="?">
<TD align='right'>

<A HREF="BarcodePrint.asp?SKUID=<%=SKUID%>&PrintType=1" target="_blank">【资产条码预览】</A>
<A HREF="BarcodePrint.asp?SKUID=<%=SKUID%>&PrintType=2" target="_blank">【故障申报条码预览】</A>
 <%If instr(AdminName,session("Emp_Name"))>0 then%><A HREF="AssetSKUedit.asp?SKUID=<%=SKUID%>" target="_blank"><FONT COLOR="#009999">【修改状态】</FONT></A><%End if%>SKUID[9位资产编码]：
<INPUT TYPE="text" NAME="SKUID" value='<%=SKUID%>'>
<INPUT TYPE="submit" value="查询">
</TD>
</FORM>
</TR>
</table>
<%
If Len(SKUID)=0 Or isnumeric(SKUID)=flase Then
%>
<BR><BR>
<CENTER>拜托，好歹也输入资产的数字编号吧！</CENTER>
<BR>
<%
else

set rslist= server.createobject("adodb.recordset")
sql_list= "select * from cmdb_List where SKUID="&SKUID
rslist.open sql_list,conn,3
If rslist.recordcount=0 Then
%>
<BR>
<FORM METHOD=POST ACTION="?">
<CENTER><FONT COLOR="#FF0000"><B>你输入的资产编码不正确！<BR>或者系统没有编号为【<%=SKUID%>】的IT资产！<BR>请用数字键盘重新输入9位的资产编码，再查询，谢谢！</B></FONT><BR><BR>
资产编码：
<INPUT TYPE="text" NAME="SKUID" value='<%=SKUID%>'>
<INPUT TYPE="submit" value="查询">
</CENTER>
</FORM>
<%
else
Sku_price=rslist("sku_price")
Dep_ID=Trim(rslist("Dep_ID"))
StockType=rslist("Stocktype") 'SkuID 属于的分类，来自 eita_stocktype
'SKU资产条码处理程序
code=SKUID
if code = "" then
 code = "[VankeITCenter]"
else
 if Checkexp("^[abcdefghijklmnopqrstuvwxyz1234567890\+\-\*\/\%\$\.]*$",code) then
  code =code
'  code =code
 else
  code = "[VankeITCenter]"
  errstr = "<br><center style='color:red;'>含有非法字符 </center>"
 end if
end if
ocode = code
code = lcase(code)
%>
<table class="table">
<TR>
	<TD valign=top>
	<%=Trim(GetCMDBType(rslist("Stocktype")))%>.<%=Trim(GetBrand(rslist("BrandID")))%>.<%=Trim(rslist("name"))%><BR>
	<B><%=FormatCurrency(Sku_price,,true)%></B><BR>
	<%=dragcode(haiwaocde(code))%><BR>
	EID:<%=code%><BR>
</TD>
<TD valign=top>
	<%
    SalvageLaste=Sku_price*4/100 '固定的转移残值
    DepreciationValue=Sku_price-SalvageLaste '96%为可折旧额
	DepreciationPeriod=60 '折旧期60个月
	DepreciationDone=DateDiff("M",rslist("intime"),Now) '已经折旧期*月
    DepreciationPerValue=DepreciationValue/DepreciationPeriod      '每期折旧额
	SalvageValue=(DepreciationPeriod-DepreciationDone)*DepreciationPerValue           '剩余残值=(折旧期-已经折旧期)*每期折旧额
	%>
	采购价格：<B><%=FormatCurrency(Sku_price,,true)%></B><BR>
	采购时间：<B><%=Trim(rslist("intime"))%></B><BR>
	发票号码：<B><%=Trim(rslist("InvoiceID"))%></B><BR>
	折旧结束：<B><%=DateAdd("M",DepreciationPeriod,rslist("intime"))%></B><BR>
	折旧：<%=DepreciationPeriod%>个月,每月<%=FormatCurrency(DepreciationPerValue,,true)%><BR>
	折旧情况：<%=DepreciationDone%>个月已折旧<BR>
	残值：<%=FormatCurrency(SalvageLaste,,true)%>[占采购价格的4%]<br>
	供折旧值：<%=FormatCurrency(DepreciationValue,,true)%><br>
	可折旧值：<B><%=FormatCurrency(SalvageValue,,true)%></B>
</TD>
<TD valign=top>
	部门：<%If Dep_ID<>"" then%><%=GetDepName(Dep_ID)%><%else%><FONT  COLOR="#999999">未分配部门</FONT><%End if%><BR>
	供应商：<A HREF="client.asp?CRM_ID=<%=rslist("CRM_ID")%>" target='_blank'><%=Trim(GetCRMName(rslist("CRM_ID")))%></A><BR>
	品牌：<%=Trim(GetBrand(rslist("BrandID")))%><BR>
	规格：<%=Trim(rslist("name"))%><BR>
	类型：<%=Trim(GetCMDBType(StockType))%><BR>
	录入：<%=GetEMPName(rslist("emp_ID"))%><BR>
	状态：<%=Trim(GetCMDBState(rslist("AssetState")))%><BR>
	来源：<%=Trim(showAssetFrom(rslist("AssetFrom")))%><BR>

	</TD>
	<TD valign=top>备注信息：<BR><%=htmlencode2(rslist("info"))%></TD>
</TR>
</TABLE>

<!-- 记录及操作 ////////////////////// -->
<table class="table">
<TR>
<!-- 报障 -->
<TD><a href="EITA_service_add.asp?SKUID=<%=SKUID%>&Emp_name=<%=GetSkuUser(SKUID)%>" target='_blank'>故障申报</a></TD>
<!-- 调拨 -->
<TD><a href="ithelp_it_user_service_add.asp?SKUID=<%=SKUID%>&Emp_name=<%=session("Emp_Name")%>" target='_blank'>调拨</a></TD>
<!-- 报废 -->
<TD><a href="ithelp_it_user_service_add.asp?SKUID=<%=SKUID%>&Emp_name=<%=session("Emp_Name")%>" target='_blank'>报废</a></TD>

</TR>
</TABLE>
<%
set rslist=Nothing
%>

<!---------明细数据HTML部分开始 ----------------------------------->
<table class="table">
<TR>
<Th colspan='30' >生命周期日志记录</Th>
</TR>
<TR bgcolor='#ddeeff'>
	<TD>日志类型</TD>
	<TD>日志主题</TD>
    <TD>成本</TD>
	<TD>发生部门</TD>
	<TD>状态</TD>
	<TD>开始/结束时间</TD>
	<TD>操作者</TD>
	<TD>说明</TD>
</TR>
<%
set rsloglist= server.createobject("adodb.recordset")
sql_list= "select * from CMDB_LogMain where SKU_ID="&SKUID&" order by id desc"
rsloglist.open sql_list,conn,1
SKULogCost=0
for loglist=1 to rsloglist.recordcount
%>
<TR bgcolor='#FFFFFF'>
	<TD><%=rsloglist("LogType")%>.<%=ShowAssetConfigType(rsloglist("LogType"))%></TD>
	<TD><%=rsloglist("Topic")%></TD>
    <TD><%=FormatCurrency(rsloglist("cost"),,true)%></TD>
	<TD><%=GetDepName(rsloglist("Dep_id"))%></TD>
	<TD><%=GetCMDBState(rsloglist("LogState"))%></TD>
	<TD><%=rsloglist("begintime")%>--<%=rsloglist("endtime")%></TD>
	<TD><%=GetEMPName(rsloglist("emp_ID"))%></TD>
	<TD><%=rsloglist("info")%>&nbsp;
<%
'管理员权限修改明细
'If Int(Session("eitam_right"))>=7 then
%>
<A HREF="AssetLogDetailEdit.asp?LogID=<%=Trim(rsloglist("id"))%>" target="_blank"><FONT COLOR="#009999">【修改】</FONT></A>
<%'End if%>
</TD>
</TR>
<%
SKULogCost=SKULogCost+rsloglist("cost")
rsloglist.movenext
next
set rsloglist=nothing
%>
<!-- 翻页------------------------------- -->
<TR bgcolor='#ddeeff'>
<TD>此物资产生的总成本：<%=SKU_Price%>+<%=SKULogCost%>=<%=SKU_Price+SKULogCost%></TD>

<TD colspan='20' align='right'>
<%IF pageno<>1 then%>
<A HREF="?pageno=1&Keyword=<%=Keyword%>&Type=<%=S_Type%>">
[首页]</A>
<%
End If
%>
<%IF pageno>1 then%>
<A HREF="?pageno=<%=pageno-1%>&Keyword=<%=Keyword%>&Type=<%=S_Type%>">
[上一页]</A>
<%
End if
IF pageno<>mpage then
%>
<A HREF="?pageno=<%=pageno+1%>&Keyword=<%=Keyword%>&Type=<%=S_Type%>">
[下一页]</A>
<%
End if
%>
<%IF pageno<>mpage then%>
<A HREF="?pageno=<%=mpage%>&Keyword=<%=Keyword%>&Type=<%=S_Type%>">
[末页]</A>
<%
End If
%>
[<%=pageno%>/<%=mpage%>]
</TD>
</TR>
<!-- 翻页------------------------------- -->
</TABLE>
<%
'分配日志管理权限列表,此列表人员管理：日志、配件、报障处理
'开始日志添加处理==================
'管理员权限修改明细
'If instr(AdminName,session("Emp_Name"))>0 then
%>
<!--明细数据HTML部分开始 ----------------------------------->
<table class="table">
<FORM METHOD=POST ACTION="CMDB_save.asp?Act=LogAdd&SKUID=<%=skuid%>">

<TR bgcolor='#FFFF99'>
<TD>
<SELECT NAME="AssetConfigType" >
<%
	set rsb= server.createobject("adodb.recordset")
	sql_s= "select * from CMDB_ConfigType where type_fatherID in (1,2,3,4,7) order by type_id desc"
	rsb.open sql_s,conn,3
	if not rsb.eof then
	 for i=1 to rsb.recordcount
%>
<option value="<%=trim(rsb("type_id"))%>" <%If trim(rsb("type_id"))=48 Then %>selected<%End if%>><%=trim(rsb("type_id"))%>.<%=rsb("type_name")%></option>
<%
rsb.movenext
next
'end if
set rsb=nothing
%>
</SELECT>
</TD>
<TD><INPUT TYPE="text" NAME="topic" size='20' ></TD>
<TD><INPUT TYPE="text" NAME="cost" size='8' value='0'></TD>
<TD>
<SELECT NAME="Department"> <!-- -->
<%
set rsc=Server.CreateObject("ADODB.Recordset")
rsc.open "select * from basic_company order by CompanyID",conn,1,1
for c=1 to rsc.recordcount
%>
<optgroup label="<%=trim(rsc("ComOrder"))%>.<%=trim(rsc("Company"))%>">
<%
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select Dep_ID,Dep_name,Dep_order from emp_dep where Dep_isshow=1 and CompanyID="&int(rsc("CompanyID"))&" order by Dep_order",conn,1,1
for d=1 to rs.recordcount
%>
<option value="<%=int(rs("Dep_ID"))%>"><%=trim(rsc("ComOrder"))%>.<%=trim(rs("Dep_order"))%>.<%=trim(rs("Dep_name"))%></option><%
rs.movenext
next
rs.close


rsc.movenext
next
rsc.close

%>
</SELECT>
</TD>
<TD><SELECT NAME="AssetState">
<%
	set rsb= server.createobject("adodb.recordset")
	sql_s= "select id,name from CMDB_state order by id"
	rsb.open sql_s,conn,3
	if not rsb.eof then
	 for i=1 to rsb.recordcount
%>
<option value="<%=trim(rsb("id"))%>" > <%=rsb("name")%></option>
<%
rsb.movenext
next
end if
set rsb=nothing
%>
</SELECT>
</TD>
<TD><INPUT TYPE="text" NAME="begintime" size='8' value='<%=date()%>'>
<INPUT TYPE="text" NAME="endtime" size='8' value='<%=date()+30%>'></TD>
<TD><INPUT TYPE="hidden" NAME="emp_ID" value='<%=session("Emp_Name")%>'size='8'  >&nbsp;</TD>
<TD><INPUT TYPE="text" NAME="info" size='14' value='说明'>
<INPUT TYPE="submit" value='<%=Trim(session("Emp_Name"))%>增加'></TD>
</TR>
</FORM>
</TABLE>
<!-- -------日志添加结束 -->
<%
End If
'IT工程师、IT主管、IT经理日志管理HTML结束===============
'///对应SKUID PC主机 内部配件列表开始
If StockType=55 Or StockType=46 Or StockType=57 Then
'****StockType=55 表明此SKU为 PC主机，只有此项才可以显示、添加关键配件
%>
<table class="table">
<TR>
<Th colspan='30' >关键配件属性记录</Th>
</TR>
<TR bgcolor='#ddeeff'>
<TD>关键配件类型</TD>
<TD>关键配件明细</TD>
<TD>时间</TD>
<TD>操作人</TD>
</TR>
<%
set rsb= server.createobject("adodb.recordset")
sql_s= "select * from CMDB_Accessries where SKUID="&SKUID&" order by id desc"
rsb.open sql_s,conn,3
for i=1 to rsb.recordcount
%>
<TR>
<TD><%=rsb("a_type")%>.<%=Trim(GetCMDBType(rsb("a_type")))%></TD>
<TD><%=rsb("topic")%></TD>
<TD><%=rsb("intime")%></TD>
<TD><%=GetEMPName(rsb("emp_ID"))%></TD>
</TR>
<%
rsb.movenext
next
set rsb=nothing
%>
<%
'///////Type_id=55  PC主机 内配件列表的管理开始
'admin=admin1+admin2 'IT工程师+主管
'if instr(admin,session("Emp_Name"))>0  Then
'管理员权限修改明细
'If Int(Session("eitam_right"))>=7 then
'If instr(AdminName,session("Emp_Name"))>0 Then
%>
<!--明细数据HTML部分开始 ----------------------------------->
<FORM METHOD=POST ACTION="CMDB_save.asp?Act=AccessriesAdd&SKUID=<%=skuid%>">
<TR bgcolor='#FFFFFF'>
<TD colspan=4>
<!-- CMDB_Type.Type_id 35.cpu/36.内存/37.主板/38.硬盘/67.显卡/92.其他配件/56.pc显示器 -->
<SELECT NAME="A_Type">
<%
	set rsb= server.createobject("adodb.recordset")
	sql_s= "select * from CMDB_Type where type_id in (35,36,37,38,67,92,56,53,54) order by type_id"
	rsb.open sql_s,conn,3
	if not rsb.eof then
	 for i=1 to rsb.recordcount
%>
<option value="<%=trim(rsb("type_id"))%>" > <%=rsb("type_name")%></option>
<%
rsb.movenext
next
end if
set rsb=nothing
%>
</SELECT>
<INPUT TYPE="text" NAME="topic" size='40' >
<INPUT TYPE="submit" value='<%=session("Emp_Name")%>增加'></TD>
</TR>
</FORM>
<%
'End if
'////////////Type_id=55  PC主机 内配件列表的管理结束
%>
</TABLE>
<%
End If
'*****StockType=55 PC主机关键配件显示、管理结束
%>
<%
'以下的end if 为shuid 空时的结束 语句
End If
'SHUID 不为空
End if
'End if
%>

</div>
</div>
<!--#include file="Footer.asp" -->